  {% extends 'admin/edu-cloud/layout.html.twig' %}

{% block title %}{{'admin.edu_cloud.key_update.content_title'|trans}} - {{ parent() }}{% endblock %}

{% set submenu = 'key' %}
{% set script_controller = 'setting/cloud-key-update' %}

{% block maincontent %}
 <div class="page-header clearfix">
      <h1 class="pull-left">{{'admin.edu_cloud.key_update.authorization_code'|trans}}</h1>
</div>
{{ web_macro.flash_messages() }}

<form class="form-horizontal" id="key-update-form" method="post" novalidate>

  <div class="form-group">
    <label class="col-md-3 control-label" for="access-key-field">AccessKey</label>
    <div class="col-md-6 controls">
      <input id="access-key-field" class="form-control" type="text" name="accessKey" value="{{ app.request.request.get('accessKey')|default(setting('storage.cloud_access_key', '')) }}">
      <p class="help-block">{{ 'admin.edu_cloud.key_update.access_key_hint'|trans|copyright_less }}</p>
    </div>
  </div>

  <div class="form-group">
    <label class="col-md-3 control-label" for="secret-key-field">SecretKey</label>
    <div class="col-md-6 controls">
      <input id="secret-key-field" class="form-control" type="text" name="secretKey" value="{{ app.request.request.get('secretKey')|default(setting('storage.cloud_secret_key', '')) }}">
    </div>
  </div>

  <div class="form-group">
    <div class="col-md-3 control-label"></div>
    <div class="controls col-md-6">
      <button type="submit" class="btn btn-primary save-btn" data-loading-text="{{'admin.edu_cloud.key_update.key_save.submiting'|trans}}...">{{'form.btn.save'|trans}}</button>
      <div class="alert alert-info mtl" role="alert">
        {{'admin.edu_cloud.key_update.key_update_hint'|trans}}
      </div>
      {% if not setting('storage.cloud_key_applied') %}
        <span class="pull-right"><span class="text-info">{{'admin.edu_cloud.key_update.ask_apply_key'|trans}}</span> <a href="javascript:;" id="key-apply-btn" class="btn btn-sm btn-warning" data-url="{{ path('admin_setting_cloud_key_apply') }}" data-goto-url="{{ path('admin_setting_cloud_key') }}"  data-loading-text="{{'admin.edu_cloud.key_update.key_apply.submiting'|trans}}">{{'admin.edu_cloud.key_update.key_apply_btn'|trans}}</a></span>
      {% endif %}

    </div>
  </div>

  <input type="hidden" name="_csrf_token" value="{{ csrf_token('site') }}">
</form>

{% endblock %}